package com.yunji.base.enums;

import java.util.Objects;

public enum AuditStatus {

    WAIT(0, "待审核"),
    ACCEPT(1, "通过"),
    REJECT(2, "驳回"),
    CANCEL(3, "撤回");

    AuditStatus(Integer code, String text) {
        this.code = code;
        this.text = text;
    }

    private final Integer code;

    private final String text;

    public Integer getCode() {
        return code;
    }

    public String getText() {
        return text;
    }

    public static String get(Integer code) {
        AuditStatus[] enums = AuditStatus.values();
        for (AuditStatus e : enums) {
            if (Objects.equals(e.code, code)) {
                return e.text;
            }
        }
        return null;
    }
}
